package jpf.nextsearch.scanner;

import java.util.ArrayList;
import java.util.List;

import jpf.nextsearch.ds.model.HostVO;
import jpf.nextsearch.processing.invoker.impl.ConcurentProcessorInvoker;

public class Test {
	
	
	public static void main(String[] s) {
		List<HostVO> hosts = new ArrayList<HostVO>();
		
		for (int i=0; i< 5; i++) {
			HostVO host = new HostVO();
			host.setIp("10.3.4.242");
			hosts.add(host);
		}
		
		ConcurentProcessorInvoker<HostVO> invoker = new ConcurentProcessorInvoker<HostVO>();
		
		invoker.setMaxThreadsCount(5);
		invoker.setProcessor(new HostScanProcessor());
		
		
		long time = System.currentTimeMillis(); 
		
		
		try {
			invoker.invokeProcessor(hosts);
			
			invoker.setActive(false);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		time = System.currentTimeMillis() - time;
		
		System.out.println("time: "+(time / 1000.0));
		
		System.out.println("END");
		
	}

}
